package cn.itcast.web;

import cn.itcast.domain.Route;
import cn.itcast.service.RouteService;
import cn.itcast.service.RouteServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "updateFindById",urlPatterns = "/updateFindById")
public class UpdateFindById extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String rid = request.getParameter("rid");
        RouteService routeService = new RouteServiceImpl();
        Route route=routeService.updateFindById(rid);
        request.setAttribute("route",route);
        request.getRequestDispatcher("/update.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
